package Ventanas;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


import Juegos.Juegos;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class PantallaInicial extends javax.swing.JFrame {
	private JPanel jPanel1;
	private JButton jButton1;
	private JButton jButton3;
	private JLabel jLabel3;
	private JLabel jLabel2;
	private JLabel jLabel1;
	private JButton jButton2;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				PantallaInicial inst = new PantallaInicial();
				inst.setMinimumSize(new Dimension(400,300));
				inst.setVisible(true);
			}
		});
	}
	
	public PantallaInicial() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jPanel1 = new JPanel();
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				jPanel1.setLayout(null);
				jPanel1.setBackground(new java.awt.Color(0,0,160));
				{
					jButton1 = new JButton();
					jPanel1.add(jButton1);
					jButton1.setBounds(29, 185, 82, 76);
					jButton1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Dibujos/mariobonus.gif")));
					jButton1.addActionListener(new MiOyente2());
				}
				{
					jButton2 = new JButton();
					jPanel1.add(jButton2);
					jButton2.setBounds(133, 185, 83, 76);
					jButton2.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Dibujos/luigibonus.gif")));
					jButton2.addActionListener(new MiOyente1());
				}
				{
					jLabel1 = new JLabel();
					
					jLabel1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Dibujos/super.GIF")));
					jPanel1.add(jLabel1);
					jLabel1.setBounds(29, 4, 210, 100);
				}
				{
					jLabel2 = new JLabel();
					jPanel1.add(jLabel2);
					jLabel2.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Dibujos/marioB.GIF")));
				     jLabel2.setBounds(162, 57, 226, 70);
				}
				{
					jLabel3 = new JLabel();
					jPanel1.add(jLabel3);
					jLabel3.setText("Seleccione el personaje para jugar:");
					jLabel3.setBounds(24, 159, 186, 14);
					jLabel3.setFont(new java.awt.Font("Arial",3,9));
					jLabel3.setForeground(new java.awt.Color(255,255,255));
				}
				{
					jButton3 = new JButton();
					jPanel1.add(jButton3);
					jButton3.setBounds(281, 216, 102, 41);
					jButton3.setText("Controles");
					jButton3.setFont(new java.awt.Font("Baskerville Old Face",1,9));
					jButton3.addActionListener(new MiOyente());
				}
			}
			pack();
			setBounds(50, 50, 400, 300);
			setSize(400, 300);
			this.setResizable(false);
		} catch (Exception e) {
		   
			e.printStackTrace();
		}
	}
	class MiOyente implements ActionListener{
		 public void actionPerformed(ActionEvent e)
		 {
			 Controles c= new Controles();
	      c.setVisible(true);
	    }
}
	class MiOyente1 implements ActionListener{
		 public void actionPerformed(ActionEvent e)
		 {
			    
			 Juegos inst = new Juegos(1);
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
		    }
	    }

	class MiOyente2 implements ActionListener{
		 public void actionPerformed(ActionEvent e)
		 
		 {
	       
		 Juegos inst = new Juegos(0);
			inst.setLocationRelativeTo(null);
			inst.setVisible(true);
	    }
}}

